package com.chenfan.ccp.executor.wrapper;

/**
 * 封装Runnable接口
 * @author wulg
 * @date 2022-04-26
 **/
public class RunnableWrapper extends AbstractWrapper implements Runnable{

    private Runnable runnable;

    public RunnableWrapper(Runnable runnable) {
        this.runnable = runnable;
    }

    @Override
    public void run() {
        try {
            this.copy();
            runnable.run();
        } finally {
            this.clear();
        }
    }
}
